package work3.work4;

public class Context implements CallBack{
    Worker worker = new Worker();
    public Context(){
        Thread thread=new Thread();
        for(int i=0;i<10;i++){
            int t=i;
            Leader leader = new Leader();
             thread = new Thread(() -> {
                leader.callWorkerToWork(worker, "完成作业：" + t, leader.callBack);
            });
            thread.start();

        }
        try {
            thread.join();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }



    }

    @Override
    public void callBack(String r) {

    }
}
